PYTHON BASICS AND PYTHON CODING EXAMPLES: PROGRAMMING FOR BEGINNERS - 2 BOOKS IN 1 - PYTHON BASICS AND CODING EXAMPLES, A QuickStart Guide, Tutorial Book by Program Examples, In Easy Steps by TAM SEL & J KING

PYTHON BASICS AND PYTHON CODING EXAMPLES: PROGRAMMING FOR BEGINNERS - 2 BOOKS IN 1 - PYTHON BASICS AND CODING EXAMPLES, A QuickStart Guide, Tutorial Book by Program Examples, In Easy Steps by TAM SEL & J KING

Author:TAM SEL & J KING [SEL, TAM]
Language: eng
Format: azw3
Published: 2020-08-08T16:00:00+00:00


Example-1: Program to print 1 to 10 using while loop

i= 1

#The while loop will iterate until condition becomes false .

While(i<= 10 ):

print(i)

i=i+ 1

Output:

1

2

3

4

5

6

7

8

9

10

Example -2: Program to print table of given numbers.

i= 1

number= 0

b= 9

number = int (input( "Enter the number:" ))

while i<= 10 :

print( "%d X %d = %d \n" %(number,i,number*i))

i = i+ 1

Output:

Enter the number:10

10 X 1 = 10

10 X 2 = 20

10 X 3 = 30

10 X 4 = 40

10 X 5 = 50

10 X 6 = 60



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.